package com.slink.xin.common.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.slink.xin.common.dao.BaseDao;
import com.slink.xin.common.domain.po.Course;
import com.slink.xin.common.domain.po.Student;
import com.slink.xin.common.mapper.StudentMapper;


@Repository
public class StudentDao extends BaseDao<StudentMapper>{
	
	public Student getById(int id)
	{
		return this.mapper.getById(id);
	}
	
	public void deleteById(Integer id)
	{
		int count = this.mapper.delete(id);
		System.out.println("删除了" + count + "行数据。");
	}
	
	public void update(Student student)
	{
		int count = this.mapper.update(student);
		System.out.println("修改了" + count + "行数据。");
	}

	public void add(Student student) {
		// TODO Auto-generated method stub
		int count = this.mapper.add(student);
		System.out.println("添加了" + count + "行数据。");
	}

	public Student getByTeaId(int id){
		return this.mapper.getBySupervisorId(id);
	};
	
	public void saveSelecCourse(Student student, Course course) {
		this.mapper.saveSelecCourse(student, course);
	}
	
	public List<Student> selectAll() {
		return this.mapper.selectAll();
	}
}
